import {
    createRouter,
    createWebHashHistory
} from  'vue-router'
import Index from '../views/index/index.vue'
import Login from '../views/login/login.vue'
import Home from '../views/home/home.vue'
import Role from '../views/role/role.vue'
import Powers from '../views/powers/powers.vue'
import User from '../views/user/user.vue'
import Mine from  '../views/mine/mine.vue'
const routes=[
    {
        path:'/',
        redirect:"/home"
    },
    {
        path:"/index",
        name:"index",
        component:Index,
        children:[
            {
                path:"/home",
                name:"home",
                meta:{
                    title:"工作台",
                    editable:true
                },
                component:Home,
            },
            {
                path:"/role",
                name:"role",
                meta:{
                    title:"角色列表",
                    editable:true
                },
                component:Role,
            },
            {
                path:"/powers",
                name:"powers",
                meta:{
                    title:"权限列表",
                    editable:true
                },
                component:Powers,
            },
            {
                path:"/user",
                name:"user",
                meta:{
                    title:"用户列表",
                    editable:true
                },
                component:User,
            },
            {
                path:"/mine",
                name:"mine",
                meta:{
                    title:"个人中心",
                    editable:true
                },
                component:Mine,
            }
        ]
    },
    {
        path:"/login",
        component:Login
    }
]
const router=createRouter({
    history:createWebHashHistory(),
    routes:routes
})
export default router